<<template>
  <div>
    <a-tabs :default-active-key="activeKey" @change="callback">
      <a-tab-pane key="1" tab="我的申请">
        <MyApply/>
      </a-tab-pane>
      <a-tab-pane key="2" tab="我的待办" force-render>
        <MyTodo/>
      </a-tab-pane>
      <a-tab-pane key="3" tab="我的已办" force-render>
        <MyDone/>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>
<script>
import MyTodo from './MyTodo'
import MyApply from './MyApply'
import MyDone from './MyDone'
export default {
  components: {
    MyTodo,
    MyDone,
    MyApply
  },
  data() {
    return {
      activeKey: "1"
    }
  },

 created() {
    console.log(JSON.stringify(this.$route.query));
    this.activeKey = this.$route.query.idx;
    
    if(this.activeKey==null)
       this.activeKey="1"
  },

  methods: {
    callback(key) {
      console.log(key)
    }
  }
}
</script>
